// pages/jsq/example.js
var h, w, bmi,value
Page({
  data: {
    bmi:"",
    value:""
  },
geth: function (event) {
//console.log(event.detail.value)
 h= event.detail.value
},


getw: function (event) {
//console.log(event.detail.value)
 w= event.detail.value
},

calculate: function () {
 bmi=Math.round(w/h**2)
if (bmi < 18)
    value = "您忒轻了";
  if (bmi >= 18 && bmi <= 24)
    value = "您身材正常";
  if (bmi >= 24 && bmi <= 30)
    value = "您有点超重";
if (bmi > 30)
    value = "肥胖，请多运动，控制饮食！！！";
 
  var that = this
  that.setData({
   bmi:bmi,
   value:value
  })
  },
  
})